[ykj_id].vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <div class="cjfx_cjd">
  3. <NavHeader />
  4. <bread-crumb />
  5. <div class="w-1200px m-auto flex flex-row justify-between mainCotent">
  6. <div class="w-188px">
  7. <leftSider :activeIndex="activeIndex" :ykjId="ykjId" @parentClick="parentClick"/>
  8. </div>
  9. <div class="w-942px p-4 blueBg">
  10. <div class="flex items-center">
  11. <optionSelect @optionClick="optionClick" />
  12. </div>
  13. <div class="mt-4 exportBtn">
  14. <el-button color="#003eee" type="primary" size="large" @click="exportBtn">导出</el-button>
  15. </div>
  16. <div class="h-218px mt-5px bg-gray-500 py-4 pl-150px pr-100px perfectShow">
  17. <div class="h-full flex justify-between" v-if="rangeData.length!=0">
  18. <div class="w-1/5 h-full bg-opacity-20 rounded flex-grow flex-shrink mr-2 singlepart" v-for="(item, index) in rangeData" :key="index">
  19. <div class="h-1/3 text-center py-4 RankLabel">
  20. <img :src="'/images/one'+(index+1)+'.png'" alt="">
  21. </div>
  22. <div class="text-sm mt-2 p-5px RankBaseInfo">
  23. <p class="h-1/4 mt-3px overflow-ellipsis whitespace-nowrap" style="overflow: hidden;" :title="item.kh">考号:{{ item.kh }}</p>
  24. <p class="h-1/4 mt-3px overflow-ellipsis whitespace-nowrap" style="overflow: hidden;" :title="item.cj">成绩:{{item.cj}}分</p>
  25. <p class="h-1/4 mt-3px overflow-ellipsis whitespace-nowrap" style="overflow: hidden;" :title="item.mc">名次:{{ item.mc }}</p>
  26. <p class="h-1/4 mt-3px overflow-ellipsis whitespace-nowrap" style="overflow: hidden;" :title="item.xx">学校:{{ item.xx }}</p>
  27. </div>
  28. </div>
  29. </div>
  30. <div class="text-center " style="line-height:218px;" v-else>
  31. 暂无排名~
  32. </div>
  33. </div>
  34. <el-table :data="tableData" :border="true" :show-header="true" :header-row-style="{ background: '#003eee' }">
  35. <el-table-column v-for="(item, index) in tableHeader" :key="index" :prop="item.prop" :label="item.label" :width="item.width">
  36. <template v-if="item.children">
  37. <el-table-column v-for="(childItem, childIndex) in item.children" :key="childIndex" :prop="childItem.prop" :label="childItem.label" :width="childItem.width"></el-table-column>
  38. </template>
  39. </el-table-column>
  40. </el-table>
  41. </div>
  42. </div>
  43. <commonFooter />
  44. </div>
  45. </template>
  46. <route lang="json">
  47. {
  48. "meta": {
  49. "title": "考试分析",
  50. "breadcrumb": true
  51. }
  52. }
  53. </route>
  54. <script lang="ts" setup>
  55. import {cjfx_cjd_list } from '../apiItem';
  56. import {user} from "~/store";
  57. const route = useRoute();
  58. // 侧边栏点击
  59. const activeIndex = ref('1-1');
  60. let ykjId = ref();
  61. const parentClick = (val: string) => {
  62. activeIndex.value = val;
  63. ykjId.value = route.params.ykj_id;
  64. }
  65. const rangeData =ref([])
  66. const tableHeader =ref([]);
  67. const tableData = ref([]);
  68. ykjId.value = route.params.ykj_id;
  69. onMounted(() => {
  70. initData();
  71. })
  72. const school_id = ref("");
  73. const grade_id = ref("");
  74. const xueke_id = ref("");
  75. // 初始化数据
  76. const initData =() => {
  77. let transObj = {
  78. school_id:school_id.value,
  79. cm_id: grade_id.value,
  80. xueke_id: xueke_id.value,
  81. jh_id:route.params.ykj_id,//考试计划id
  82. }
  83. cjfx_cjd_list(transObj)
  84. .then(res => {
  85. if (res.code == "1") {
  86. rangeData.value = res.data.data.rangeData;
  87. tableHeader.value = res.data.data.tableHeader;
  88. if (res.data.data.tableData[0].length == '0') {
  89. tableData.value = [];
  90. } else {
  91. tableData.value = res.data.data.tableData;
  92. }
  93. }
  94. })
  95. .catch(error=>{console.log(error)})
  96. }
  97. //option筛选
  98. const optionClick = (val: any, marke: any) => {
  99. if (marke == "scholl") {
  100. school_id.value = val;
  101. } else if (marke == "grade") {
  102. grade_id.value = val;
  103. } else {
  104. xueke_id.value = val;
  105. }
  106. initData();
  107. }
  108. //导出
  109. const exportBtn = () => {
  110. let prefixedUrl = window.GLOBAL_CONFIG.web_pc;
  111. let fullUrl = prefixedUrl + '/openapi/echart/transcript.php?api=xls&token=' + user.value.token;
  112. window.open(fullUrl,'_blank')
  113. }
  114. </script>
  115. <style lang="scss" scoped>
  116. :deep(.is-group tr th){
  117. background: #003eee!important;
  118. color:#ffffff;
  119. border:0 ;
  120. }
  121. :deep(.el-sub-menu__title){
  122. background: #003eee;
  123. color: #fff;
  124. }
  125. .blueBg {
  126. background: #F1F7FF;
  127. }
  128. .whiteBG {
  129. background: #fff;
  130. }
  131. .mainCotent{
  132. min-height:665px;
  133. }
  134. .singlepart {
  135. background-color: rgba($color: #ffffff, $alpha: 0.2);
  136. color: #fff;
  137. }
  138. .listMain {
  139. max-height: 600px;
  140. overflow-x: auto;
  141. }
  142. .listMain_title {
  143. font-size: 16px;
  144. color: #fff;
  145. background: #003eee;
  146. overflow-y: auto;
  147. }
  148. .singleTitle {
  149. // flex: 1;
  150. // width: fit-content;
  151. line-height: 74px;
  152. width:100px;
  153. text-align: center;
  154. }
  155. .singleDupli {
  156. // flex: 1;
  157. width:150px;
  158. }
  159. .singleContentSec {
  160. // width: fit-content;
  161. // flex: 1;
  162. width:100px;
  163. line-height: 60px;
  164. text-align: center;
  165. }
  166. .singleDSec {
  167. // flex: 1;
  168. line-height: 60px;
  169. width:150px;
  170. }
  171. .secFullWidth {
  172. width: fit-content;
  173. flex: 1;
  174. text-align: center;
  175. }
  176. .perfectShow{
  177. background: url("/images/big_bg.png") no-repeat left top;
  178. background-size:cover;
  179. }
  180. .RankLabel{
  181. text-align: center;
  182. img{
  183. display: inline-block;
  184. width: 30%;
  185. }
  186. }
  187. </style>